package com.lagou.rpc.consumer.controller;

import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.consumer.process.RpcReference;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * description UserController
 * author wy
 * date 2021-07-18 22:00
 **/
@RestController
@RequestMapping("/user")
public class UserController {

    @RpcReference
    private IUserService iUserService;

    @RequestMapping("/{id}")
    public String getUserById(@PathVariable int id) {
        return iUserService.getById(id).toString();
    }
}
